﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using XRM.Security.DataAccess.Interfaces;

namespace XRM.Security.DataAccess.Models
{
    [Table("WorkKind")]
    public class WorkKind : IRemovable
    {
        public WorkKind()
        {
            Spec = new List<WorkKindSpec>();
            CustomId = 0;
        }

        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int WorkKindId { get; set; }

        [Required]
        public int CustomId { get; set; }

        [Required]
        [MaxLength(200)]
        public string WorkKindName { get; set; }

        [MaxLength(500)]
        public string Description { get; set; }

        [Required]
        public bool IsLinkedWithSign { get; set; }
        [Required]
        public bool IsFixed { get; set; }
        [Required]
        public bool IsDeleted { get; set; }
        
        public virtual ICollection<WorkKindSpec> Spec { get; set; }
    } 
}